class Solution(object):
    def minCostClimbingStairs(self, cost):
        """
        :type cost: List[int]
        :rtype: int
        """
        n = len(cost)
        DP = [0] * (n + 1)
        DP[0] = 0
        DP[1] = 0
        for i in range(2, n + 1):
            DP[i] = min(DP[i - 2] + cost[i - 2], DP[i - 1] + cost[i - 1])
        return DP[-1]
